/*
 * Copyright (c) 2009. Silenus Consultoria, S.L.
 */
package es.silenus.detecta.dao;

import es.silenus.detecta.model.Survey;

import java.util.List;
import java.util.Map;


/**
 * @author <a href="mailto:dgarcia@silenus-consultoria.es">Daniel Garc&iacute;a</a>
 * @since 01-abr-2009 11:31:01
 */
public interface SurveyDAO extends ReadWriteDAO<Survey, Integer> {
	/**
	 * Finds a Survey by its code (unique in an organization)
	 *
	 * @param code the code.
	 * @param organizationId the organizationId.
	 *
	 * @return the training action.
	 */
	public Survey findByCode(String code, int organizationId);

	/**
	 * Retrieves the removal information of entities with the given keys.
	 *
	 * @param keys the keys.
	 *
	 * @return the information requested.
	 */
	public List<Map<String, Object>> getRemovalInformation(final Integer[] keys);

	/**
	 * Removes surveys by keys.
	 *
	 * @param keys the keys.
	 */
	public void remove(final Integer[] keys);

	/**
	 * Retrieves the question tree.
	 *
	 * @param surveyId the survey identifier.
	 *
	 * @return the question tree.
	 */
	public List<Map<String, Object>> fetchQuestionTree(int surveyId);

	/**
	 * Retrieves active surveys by organization.
	 *
	 * @param organizationId the organization id.
	 *
	 * @return the list of active surveys.
	 */
	public List<Survey> findActiveSurveys(int organizationId);
}
